<template>
  <div class="brand-wrapper">

    <!--    操作区域  -->
    <div class="exec-box">
      <el-button type="primary" size="mini" @click="addBtnClick"  v-if="true" disabled>新建</el-button>
    </div>
    <!--    数据表格-->
    <el-scrollbar>
      <el-table

          :data="tableData"
          style="width: 100%">

        <el-table-column
            align="center"
            prop="cronId"
            label="定时id"
            width="80"
        >
        </el-table-column>
        <el-table-column
            align="center"
            prop="cronExpress"
            label="表达式"
        >
        </el-table-column>
        <el-table-column
            align="center"
            prop="cronDesc"
            label="描述信息"
        >
        </el-table-column>


        <el-table-column
            align="center"
            label="操作"
        >

          <template v-slot="obj">
            <el-button type="primary" size="mini"  @click="pause(obj.row.cronId)" v-hasperm="'task:time:pause'">暂停</el-button>
            <el-button type="warning" size="mini" @click="resume(obj.row.cronId)" v-hasperm="'taks:time:resume'">启动</el-button>
            <el-button type="success" size="mini" @click="findById(obj.row.cronId)" v-hasperm="'taks:time:edit'">编辑</el-button>
            <el-popconfirm
                style="margin-left: 8px"
                confirm-button-text='好的'
                cancel-button-text='不用了'
                icon="el-icon-info"
                @confirm="deleteById(obj.row.cronId)"
                icon-color="red"
                title="这是一段内容确定删除吗？"
            >
              <el-button slot="reference" size="mini" type="danger" v-hasperm="'task:time:delete'">删除</el-button>
            </el-popconfirm>

          </template>

        </el-table-column>

      </el-table>
    </el-scrollbar>

    <!--    新建弹框-->
    <el-dialog
        title="实体操作"
        :visible.sync="createDialog"
        width="40%">
      <el-form ref="form" label-width="80px" label-position="middle" size="mini">

            <el-form-item label="表达式">
              <el-input v-model="formData.cronExpress"></el-input>
            </el-form-item>

        <el-form-item label="描述">
          <el-input v-model="formData.cronDesc"></el-input>
        </el-form-item>
      </el-form>
      <span slot="footer" class="dialog-footer">
    <el-button @click="createDialog = false" size="mini">取 消</el-button>
    <el-button type="success" @click="addOrEdit" size="mini">确 定</el-button>
  </span>
    </el-dialog>
  </div>

</template>

<script src="./index.js"></script>

<style src="./index.scss" lang="scss">

</style>
